
package com.example.quicklaunch;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class Receiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        MLog.d("onReceive=>" + action);
        if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {
            context.startService(AllAppListService.createInitServiceIntent(context, false));
        } else if (Intent.ACTION_PACKAGE_ADDED.equals(action)) {
            String packageName = intent.getData().getSchemeSpecificPart();
            context.startService(AllAppListService.createAppAddedIntent(context, packageName));
        } else if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
            String packageName = intent.getData().getSchemeSpecificPart();
            context.startService(AllAppListService.createAppRemovedIntent(context, packageName));
        } else if (Intent.ACTION_LOCALE_CHANGED.equals(action)) {
            context.startService(AllAppListService.createInitServiceIntent(context, true));
        }
    }

}
